﻿/// <reference path="../Libriries/jquery-2.0.3.js" />
/// <reference path="../Libriries/q.js" />
/// <reference path="class.js" />

var LectureController = (function () {
    var LECTURE_STRUCTURE_PATH = "../Views/lecture-structure.html";
    var LECTURES_PATH = "../Views/Lectures/BG/";

    var HOLDER_ID = "#holder";
    //TODO: 
    //1. Go from a selected lecture to LectureStructure
    //2. Get address and title of lecture content 
    var loadLecture = function (name, contentPath) {
        var holder = $(HOLDER_ID);
        holder.html(null);

        holder.load(LECTURE_STRUCTURE_PATH, function () {
            var header = $("#lecture-head");
            header.text(name);

            var content = $("#lecture-content");
            content.load(LECTURES_PATH + contentPath);
        });
        
    }

    var changeLectureLanguage = function (language) {
        LECTURES_PATH = "../Views/Lectures/" + language + "/";
    }

    return {
        loadLecture: loadLecture,
        changeLectureLanguage: changeLectureLanguage
    }
}());